package com.jay.lang.reflect.clazz;

import java.lang.reflect.Array;

public class ArrayCls {
	public static void main(String[] args) {
//		System.out.println(Integer.TYPE);
//		System.out.println(int.class);
		int[] dimensions = new int[] { 5, 10, 15 };
		Object array = Array.newInstance(Integer.TYPE, dimensions);
		Object array1 = Array.get(array, 3);
		Object array2 = Array.get(array1, 5);

		// result: class [[I
		System.out.println(array.getClass().getComponentType());
		// result: class [I
		System.out.println(array1.getClass().getComponentType());
		// result: int
		System.out.println(array2.getClass().getComponentType());
		Array.set(array2, 10, 37);
		int[][][] value = (int[][][]) array;
		System.out.println(value[3][5][10]);
		System.out.println(Array.get(array2, 10));
		System.out.println(Array.getFloat(array2, 10));

	}
}
